//
//  YDRechargeController.m
//  PeiZiWangBei
//
//  Created by LK-IOS on 2017/11/13.
//  Copyright © 2017年 LK-IOS. All rights reserved.
//

#import "YDRechargeController.h"
#import "YDRechargeTopView.h"
#import "YDRechargeTableCell.h"
#import "YDRechargeTableFooterView.h"
#import "YDRechargeTableHeaderView.h"
#import "YDRechargeWithdrawalButtonView.h"
#import "YDEditInformationController.h"//编辑支行信息
#import "YDBindBankCardController.h"//绑卡

#import "YDAdvertViewController.h"
#import "OttoKeyboardView.h"

#import "YDPaymentPasswordController.h" //支付密码vc
#import "YDBankCardModel.h"
#import "YDRechargeSuccessViewController.h"
#import "YDChoosePayTypeFooterView.h"

#import "YDEnterVerifyCodeAlert.h"
#import "YDRechargeSuccessViewController.h"

static NSString * const PayCharge = @"/payment/recharge";

@interface YDRechargeController ()<UITextFieldDelegate , UITableViewDelegate , UITableViewDataSource , SYRechargeTableFooterViewDelegate , SYRechargeTableCellDelegate,SYRechargeWithdrawalButtonViewDelegate,TextFieldClickReturnDelegate>
//顶部显示余额
@property (nonatomic , weak) YDRechargeTopView *topView;
//金额
@property (nonatomic , weak) UIView *accountContentView;
//金额label
@property (nonatomic , weak) UILabel *accountLabel;
//金额输入框
@property (nonatomic , weak) OttoTextField *accountTextField;
//tableView
@property (nonatomic , weak) UITableView *tableView;
//当前选中的银行model
@property (nonatomic, strong)YDBankCardModel *currentBankModel;


//充值按钮
@property (nonatomic , weak) YDRechargeWithdrawalButtonView *buttonView;

//已绑卡数组
@property (nonatomic , strong) NSMutableArray *tiedCardArray;


@property (nonatomic, strong)NSString *paymentNo;

@end

@implementation YDRechargeController

-(NSMutableArray *)tiedCardArray
{
    if (_tiedCardArray == nil) {
        _tiedCardArray = [NSMutableArray array];
    }
    return _tiedCardArray;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"充值";
    [self.navigationController.navigationBar setHidden:YES];
    self.view.backgroundColor = NumberColor(247, 247, 247);
    [self dismissKeyBoard];
    [self topView];
    [self addTextField];
    [self tableView];
    [self buttonView];
    [self setUpDataManger];
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSString *accountString = [[SYUserDataManger sharedInstance] getUserAccountNumberString];
    self.topView.amountString = accountString;
    
    [self loadData];
    
}


/**
 获取快捷支付验证码
 */
- (void)getQuickPayMessage
{
    NSMutableDictionary *pramas = [NSMutableDictionary new];
    [pramas setValue:self.accountTextField.text forKey:@"amount"];
//    [pramas setValue:@(0.01) forKey:@"amount"];
    [pramas setValue:@(self.currentBankModel.Id) forKey:@"bindCardId"];
    
    [[SYProgressHUD sharedInstance] showMBHudWithSting:kLoadingText];
    
    [BaseNetRequest sessionRequestWithparameters:pramas
                                               method:POSTMethod
                                           requstType:PostQuickPayMessage
                                     WithSuccessBlock:^(NSDictionary *resultDict) {
        [[SYProgressHUD sharedInstance] dismissMBWithTime:0];
 
        if ([resultDict[@"code"] integerValue] == 200) {
            
            [self showCodeAlert];
            self.paymentNo = [resultDict objectForKey:@"result"];
        }else{
            
            [[NavTipsView defaultTipsView] showTipsBannerInView:self.view
                                                            WithType:NavTipsViewTypeMessage text:resultDict[@"message"]
                                                          isExistNav:NO];

        }
    } failBlock:^(NSError *error) {
        
        [[SYProgressHUD sharedInstance] dismissMBWithTime:0];
        
        [[NavTipsView defaultTipsView] showTipsBannerInView:self.view WithType:NavTipsViewTypeMessage text:@"充值失败,请稍后重试！" isExistNav:NO];

    }];
}


- (void)showCodeAlert
{
    LK(weslf);
    YDEnterVerifyCodeAlert *alert = [[YDEnterVerifyCodeAlert alloc] initWithFrame:CGRectMake(0, 0, LKScreenW, LKScreenH) inputFinish:^(NSString *code) {
        
        if ([code isEqualToString:@"重新获取"]) {
            //调用获取验证码;
            [weslf getQuickPayMessage];
        }else
        {
            //点击了确认支付
            if (!code.length) {
                 [[NavTipsView defaultTipsView] showTipsBannerInView:self.view WithType:NavTipsViewTypeMessage text:@"请输入验证码！" isExistNav:NO];
                //没有输入验证码 直接支付提示
            }else
            {
                [weslf quickPayCode:code];
            }
            
        }
    }];
    alert.money = self.accountTextField.text;
    alert.model = self.currentBankModel;
    [alert show];
}

- (void)quickPayCode:(NSString *)code
{
    NSMutableDictionary *pramas = [NSMutableDictionary new];
    [pramas setValue:self.paymentNo forKey:@"paymentNo"];
    [pramas setValue:@(self.currentBankModel.Id) forKey:@"bindCardId"];
    [pramas setValue:code forKey:@"validaCode"];
    
    [[SYProgressHUD sharedInstance] showMBHudWithSting:kLoadingText];
    
    [BaseNetRequest sessionRequestWithparameters:pramas
                                               method:POSTMethod
                                           requstType:PostQuickPay
                                     WithSuccessBlock:^(NSDictionary *resultDict) {
        [[SYProgressHUD sharedInstance] dismissMBWithTime:0];
        
        if ([resultDict[@"code"] integerValue] == 200) {
            YDRechargeSuccessViewController *vc = [[YDRechargeSuccessViewController alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            
            //跳转充值成功页面
        }else{
            
            [[NavTipsView defaultTipsView] showTipsBannerInView:self.view WithType:NavTipsViewTypeMessage text:resultDict[@"message"] isExistNav:NO];
            
        }
    } failBlock:^(NSError *error) {
        
        [[SYProgressHUD sharedInstance] dismissMBWithTime:0];
        
        [[NavTipsView defaultTipsView] showTipsBannerInView:self.view WithType:NavTipsViewTypeMessage text:@"充值失败,请稍后重试！" isExistNav:NO];
    }];
}


#pragma mark -UITextFieldDelegate
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [self.view endEditing:YES];
    return YES;
}

- (void)textFieldDidChange:(UITextField *)textField
{
    [self updateConfirmBtn];
    
}


-(void)updateConfirmBtn
{
    if (self.currentBankModel.isSelected && self.accountTextField.text.length) {
        [self.buttonView enableButton];
    }else
    {
        [self.buttonView disableButton];
    }
}


#pragma mark - 点击充值
- (void)rechargeWithdrawalButtonViewButtonClick

{
    
    //金额限制
    if(![NSString isFloatNumString:self.accountTextField.text])
    {
        [[NavTipsView defaultTipsView] showTipsBannerInView:self.view WithType:NavTipsViewTypeMessage text:@"请输入正确的金额，金额不能低于100元" isExistNav:NO];
        return;
    }
    
    if (![NSString isMaxMoney:self.accountTextField.text]) {
        [[NavTipsView defaultTipsView] showTipsBannerInView:self.view WithType:NavTipsViewTypeMessage text:@"单笔充值金额不超过4500元" isExistNav:NO];
        return;
    }
    
    [self getQuickPayMessage];
  
}


//- (void)pay
//{
//
//    //跳转网页
//    // http://10.0.0.99:8083/tactics/payment/recharge?publisherId=10&paymentType=1&amount=36&bindCardId=14
//
//    //paymentType:1银联支付,2扫码支付
//    NSDictionary *dic = @{@"publisherId" : [[SYUserDataManger sharedInstance] getUser_Id],
//                          @"paymentType" : @1,
//                          @"amount"      : self.money,
//                          @"bindCardId"  : @(self.currentBankModel.Id),
//                          };
//    NSString *paramStr = [NSString urlPramsStrWithDic:dic];
//
//    NSString *url = [NSString stringWithFormat:@"%@%@?%@",baseUrlHttp,PayCharge,paramStr];
//
//    YDAdvertViewController *payVc = [[YDAdvertViewController alloc] init];
//    payVc.urlStr = url;
//    payVc.title = @"银联充值";
//
//    [self.navigationController pushViewController:payVc animated:YES];
//}

//#pragma mark - 获取设置支付密码信息
//-(void)loadUserCardBindInfo
//{
//
//    [[SYProgressHUD sharedInstance] showMBHudWithSting:kLoadingText];
//
//    [SYBaseAFNNetRequest sessionRequestWithparameters:nil method:GETMethod requstType:GetSettingInformationList WithSuccessBlock:^(NSDictionary *resultDict) {
//        [[SYProgressHUD sharedInstance] dismissMBWithTime:0];
//        DDLog(@"%@",resultDict)
//        DDLog(@"%@",resultDict[@"message"])
//        if ([resultDict[@"code"] integerValue] == 200) {
//
//            BOOL isBindCard = [resultDict[@"result"][@"settingPaymentPassword"] boolValue];
//
//            if (!isBindCard) {
//                [self goSetupPayPassword];
//            }
//            else
//            {
//                [self pay];
//            }
//
//        }else{
//
//            [[SYBannerTipsView defaultTipsView] showTipsBannerInView:self.view WithType:BannerViewTypeMessage text:@"信息加载出错，请重试~" isExistNav:NO];
//
//            [self.navigationController popViewControllerAnimated:YES];
//        }
//    } failBlock:^(NSError *error) {
//
//        [[SYProgressHUD sharedInstance] dismissMBWithTime:0];
//
//        [[SYBannerTipsView defaultTipsView] showTipsBannerInView:self.view WithType:BannerViewTypeMessage text:@"信息加载出错，请重试~" isExistNav:NO];
//        [self.navigationController popViewControllerAnimated:YES];
//    }];
//}


-(void)goChargeAlert
{

    PZTipsAlertView *alert = [PZTipsViewManger shareSingleTipsAlertViewTitle:@"提示" Mesage:@"您还没有填写支行信息，请先填写支行信息" ButtonTitle:@"去填写" ButtonClickBlock:^{
        
        
        [self.pz_popupController dismiss];
        YDEditInformationController *editBankVc = [[YDEditInformationController alloc] init];
        editBankVc.hidesBottomBarWhenPushed = YES;
        editBankVc.model = self.currentBankModel;
        [self.navigationController pushViewController:editBankVc animated:YES];
    }];
    self.pz_popupController = [[PZPopUpController alloc] init];
    [self.pz_popupController dropAnimatedWithRotateAngle:30];
    [self.pz_popupController presentContentView:alert duration:0.75 springAnimated:YES];
}

-(void)goSetupPayPassword
{
    PZTipsAlertView *alert = [PZTipsViewManger shareSingleTipsAlertViewTitle:@"提示" Mesage:@"您还没有设置支付密码，请先设置支付密码" ButtonTitle:@"去设置" ButtonClickBlock:^{
        
        
        [self.pz_popupController dismiss];
        YDPaymentPasswordController *vc = [[YDPaymentPasswordController alloc] init];

        [self.navigationController pushViewController:vc animated:YES];
    }];
    self.pz_popupController = [[PZPopUpController alloc] init];
    [self.pz_popupController dropAnimatedWithRotateAngle:30];
    [self.pz_popupController presentContentView:alert duration:0.75 springAnimated:YES];
}
////*******YDRechargeTopView********////
-(YDRechargeTopView *)topView
{
    if (_topView == nil) {
        NSString *accountString = [[SYUserDataManger sharedInstance] getUserAccountNumberString];
        YDRechargeTopView *topView = [YDRechargeTopView rechargeTopViewWithAmount:accountString];
        __weak typeof(self)weself = self;
        topView.title = @"充值";
        [topView setBackBlock:^(BOOL isSelected) {
            [weself.navigationController popViewControllerAnimated:YES];
        }];
        [self.view addSubview:topView];
        [topView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(self.view);
            if (isPhoneX) {
                make.height.equalTo(@(rateX812(170) + 24));
            }else{
                make.height.equalTo(@(rate750(170)));
            }
        }];
        _topView = topView;
    }
    return _topView;
}
//添加输入框
-(void)addTextField
{
    [self accountContentView];
    [self accountLabel];
    [self accountTextField];
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    NSArray *subviews = [self.view subviews];
    for (UITextField *textField in subviews) {
        if (textField == self.accountTextField) {
            [self.accountTextField resignFirstResponder];
        }
    }
    
}


#pragma mark - TextFieldClickReturnDelegate
- (void)textFieldClickReturn:(OttoTextField *)textField{
    [textField resignFirstResponder];
    NSLog(@"return - %@",textField.text);
}

/*********accountContentView*******///////
-(UIView *)accountContentView
{
    if (_accountContentView == nil) {
        UIView *accountContentView = [[UIView alloc] init];
        [self.view addSubview:accountContentView];
        accountContentView.backgroundColor = [UIColor whiteColor];
        accountContentView.userInteractionEnabled = YES;
        [accountContentView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self.view);
            if (isPhoneX) {
                make.top.equalTo(self.topView.mas_bottom).offset(rateX812(10));
                make.height.equalTo(@(rateX812(50)));
            }else{
                make.top.equalTo(self.topView.mas_bottom).offset(rate750(10));
                make.height.equalTo(@(rate750(50)));
            }
        }];
        _accountContentView = accountContentView;
    }
    return _accountContentView;
}
//金额label
-(UILabel *)accountLabel
{
    if (_accountLabel == nil) {
        UILabel *accountLabel = [[UILabel alloc] init];
        [self.accountContentView addSubview:accountLabel];//104 114 132
        accountLabel.textColor = NumberColor(104, 114, 132);
        accountLabel.font = [UIFont systemFontOfSize:font14ScreenWRate * LKScreenW];
        accountLabel.text = @"金额";
        accountLabel.textAlignment = NSTextAlignmentCenter;
        [accountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.accountContentView);
            make.left.equalTo(self.accountContentView);
            make.width.equalTo(@(rate375(61)));
        }];
        _accountLabel = accountLabel;
    }
    return _accountLabel;
}
-(OttoTextField *)accountTextField
{
    if (_accountTextField == nil) {
        OttoTextField *accountTextField = [[OttoTextField alloc] init];
        [self.accountContentView addSubview:accountTextField];
        accountTextField.textColor = [UIColor blackColor];
        accountTextField.font = [UIFont systemFontOfSize:font14ScreenWRate * LKScreenW];
        accountTextField.placeholder = @"请输入充值金额";
        accountTextField.backgroundColor = [UIColor clearColor];
        accountTextField.borderStyle = UITextBorderStyleNone;
        accountTextField.textAlignment = NSTextAlignmentLeft;
        accountTextField.keyboardType = UIKeyboardTypeNumberPad;
        [accountTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
        accountTextField.autocapitalizationType = UITextAutocapitalizationTypeNone;
        
        
        [accountTextField setKeyboardType:KeyboardTypeNumber];
        [accountTextField setNumberKeyboardType:NumberKeyboardTypeNumber];
        accountTextField.autocapitalizationType = UITextAutocapitalizationTypeNone;
        accountTextField.textFieldClickReturnDelegate = self;
        
        
        accountTextField.returnKeyType =UIReturnKeyDone;
        [accountTextField setClearButtonMode:UITextFieldViewModeWhileEditing];
        [accountTextField mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.accountContentView);
            make.left.equalTo(self.accountLabel.mas_right);
            make.right.equalTo(self.accountContentView.mas_right).offset(-rate375(16));
            if (isPhoneX) {
                make.height.equalTo(@(rateX812(20)));
            }else{
                make.height.equalTo(@(rate750(20)));
            }
        }];
        accountTextField.tintColor = [UIColor blackColor];
        accountTextField.delegate = self;
        
        _accountTextField = accountTextField;
    }
    return _accountTextField;
}
//tableView
-(UITableView *)tableView
{
    if (_tableView == nil) {
        
        UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
        [self.view addSubview:tableView];
        tableView.backgroundColor = NumberColor(247, 247, 247);
        tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        tableView.dataSource = self;
        tableView.delegate = self;
        tableView.estimatedRowHeight = 0;
        tableView.estimatedSectionFooterHeight = 0;
        tableView.estimatedSectionHeaderHeight = 0;
//        tableView.scrollEnabled = NO;
        
        [tableView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self.view);
            make.top.equalTo(self.accountContentView.mas_bottom).offset(isPhoneX ? rateX812(12) : rate750(12));
            
        }];
        if (isIos11) {
            tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        }
        _tableView = tableView;
    }
    return _tableView;
}
/////********充值按钮*******///////
-(YDRechargeWithdrawalButtonView *)buttonView
{
    if (_buttonView == nil) {
        YDRechargeWithdrawalButtonView *buttonView = [YDRechargeWithdrawalButtonView rechargeWithdrawalButtonWithButtonTitle:@"充值"];
        buttonView.delegate = self;
        [self.view addSubview:buttonView];
        
        [buttonView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self.view);
            if (isPhoneX) {
                make.height.equalTo(@(rateX812(63)));
            }else{
                make.height.equalTo(@(rate750(50)));
            }
        }];
        _buttonView = buttonView;
    }
    return _buttonView;
}

/////******加载数据**********////

-(void)setUpDataManger
{
    
    MJGIFHeader *header = [MJGIFHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadData)];
    //隐藏时间
    header.lastUpdatedTimeLabel.hidden = YES ;
    //隐藏状态
    header.stateLabel.hidden = YES ;
    self.tableView.mj_header = header;
    header.lastUpdatedTimeLabel.hidden = YES ;
    
    [header beginRefreshing];
}

-(void)loadData
{
    [[SYProgressHUD sharedInstance] showMBHudWithSting:kLoadingText];
    [BaseNetRequest sessionRequestWithparameters:nil method:GETMethod requstType:BindBankCardList WithSuccessBlock:^(NSDictionary *resultDict) {
        [self.tableView.mj_header endRefreshing];
        [[SYProgressHUD sharedInstance] dismissMBWithTime:0];
        if ([resultDict[@"code"] integerValue] == 200) {
            self.tiedCardArray = [YDBankCardModel mj_objectArrayWithKeyValuesArray:resultDict[@"result"]];
            
            if (self.tiedCardArray.count) {
                
                
                if (self.currentBankModel == nil) {
                    YDBankCardModel *obj = [self.tiedCardArray firstObject];
                    obj.isSelected = YES;
                    self.currentBankModel = obj;
                }else
                {
                    [self.tiedCardArray enumerateObjectsUsingBlock:^(YDBankCardModel * obj, NSUInteger idx, BOOL * _Nonnull stop) {
                        //每次进来请求刷新数据选中model问题
                        if (self.currentBankModel && self.currentBankModel.Id == obj.Id) {
                            obj.isSelected = YES;
                            self.currentBankModel = obj;
                            *stop = YES;
                        }
                        
                    }];
                }

            }
          
            
            [self.tableView reloadData];
            
        }else{
      [[NavTipsView defaultTipsView] showTipsBannerInView:self.view WithType:NavTipsViewTypeMessage text:@"信息加载出错，请重试~" isExistNav:YES];
            
        }
    } failBlock:^(NSError *error) {
        [self.tableView.mj_header endRefreshing];
        [[SYProgressHUD sharedInstance] dismissMBWithTime:0];
        [[NavTipsView defaultTipsView] showTipsBannerInView:self.view WithType:NavTipsViewTypeMessage text:@"信息加载出错，请重试~" isExistNav:YES];
    }];
   
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.tiedCardArray.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return isPhoneX ? rateX812(125) : rate750(125);
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return isPhoneX ? rateX812(38) : rate750(38);
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return isPhoneX ? rateX812(300) : rate750(300);
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    YDRechargeTableHeaderView *headerView = [YDRechargeTableHeaderView headerViewWithTableView:tableView];
    return headerView;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    YDRechargeTableFooterView *footerView = [YDRechargeTableFooterView footerViewWithTableView:tableView];
    footerView.delegate = self;
    return footerView;
    
//    YDChoosePayTypeFooterView *footer = [YDChoosePayTypeFooterView footerViewWithTableView:tableView];
//    return footer;
}

#pragma SYRechargeTableFooterViewDelegate
-(void)rechargeTableFooterViewDidClickAddButton:(YDRechargeTableFooterView *)footerView
{
//    DDLog(@"添加银行卡")
    YDBindBankCardController *vc = [[YDBindBankCardController alloc] init];
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    YDRechargeTableCell *cell = [YDRechargeTableCell cellWithTableView:tableView];
    cell.delegate = self;
    
    YDBankCardModel *model = self.tiedCardArray[indexPath.row];
    cell.model = model;
    cell.payStyle = Recharge;
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    for (int i = 0 ; i < self.tiedCardArray.count ; i ++) {
        YDBankCardModel *model = self.tiedCardArray[i];
        if (i != indexPath.row) {
            model.isSelected = NO;
        }else{
            model.isSelected = !model.isSelected;
            self.currentBankModel = model;
        }
        
    }
    
    [self updateConfirmBtn];
    [self.tableView reloadData];
}
#pragma SYRechargeTableCellDelegate
-(void)rechargeTableCellDidSelected:(YDRechargeTableCell *)cell
{

    //点击选择了某一张银行卡
    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
    
    for (int i = 0 ; i < self.tiedCardArray.count ; i ++) {
        YDBankCardModel *model = self.tiedCardArray[i];
        if (i != indexPath.row) {
            model.isSelected = NO;
        }else{
            model.isSelected = !model.isSelected;
            self.currentBankModel = model;
        }
    }
    [self updateConfirmBtn];
    [self.tableView reloadData];

}



//编辑支行信息
-(void)rechargeTableCellDidClickChangeBankInformation:(YDRechargeTableCell *)cell
{
    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
    YDBankCardModel *model = self.tiedCardArray[indexPath.row];
    YDEditInformationController *vc = [[YDEditInformationController alloc] init];
    vc.model = model;
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}

@end
